from tornado import web
import tornado.ioloop
from Forum.urls import urlpatterns
from Forum.settings import settings
from peewee_async import Manager
from Forum.settings import db

class MainHandler(web.RequestHandler):
    pass

if __name__ == '__main__':
    import wtforms_json
    wtforms_json.init()
    app = web.Application(urlpatterns, debug=True, **settings)
    app.listen(8888)

    objects = Manager(db)
    db.set_allow_sync(False)
    app.objects = objects
    tornado.ioloop.IOLoop.current().start()